<template>
  <div class="productChart-wrapper">
    <h1 class="productChart-title">{{title}}</h1>
    <div class="productChart-content">
      <h4>{{subTitle}}</h4>
      <!--<img :src="url" alt="">-->
      <div class="img" :style="{backgroundImage: 'url(' + url + ')', backgroundSize: bgSize, width: imgWidth}"></div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "ProductChart",
    props: {
      url: String,
      bgSize: {
        type: String,
        default: '70%'
      },
      imgWidth: {
        type: String,
        default: '100%'
      },
      title: String,
      subTitle: String
    }
  };
</script>

<style lang="less">
  .productChart-wrapper {
    background-color: #ffffff;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    .productChart-title {
      color: #272727;
      font-size: 55px;
    }

    .productChart-content {
      width: 60%;
      height: 400px;
      border: 1px solid #9393D3;
      margin-top: 20px;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;

      h4 {
        position: absolute;
        top: -15px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #ffffff;
        color: #272727;
        padding: 5px 20px;
      }

      .img {
        width: 100%;
        height: 100%;
        background-position: center;
        background-repeat: no-repeat;
      }
    }
  }

  @media screen and (max-width: 768px) {
    .productChart-wrapper {
      background-color: #ffffff;
      height: unset;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      padding: 50px 0;

      .productChart-title {
        color: #272727;
        font-size: 55px;
      }

      .productChart-content {
        width: calc(100% - 30px);
        height: 250px;
        border: 1px solid #9393D3;
        margin-top: 20px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;

        h4 {
          position: absolute;
          top: -15px;
          left: 50%;
          transform: translateX(-50%);
          background-color: #ffffff;
          color: #272727;
          padding: 5px 20px;
        }

        .img {
          width: 100%;
          height: 100%;
          background-position: center;
          background-repeat: no-repeat;
        }
      }
    }
  }
</style>
